package com.huakang.utils;

import com.huakang.utils.StatusCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVo {
    private Integer code;
    private String message;
    private Object data;


    public static ResultVo success(String message,Object data){
        return new ResultVo(StatusCode.SUCCESS_CODE,message,data);

    }
    public static ResultVo success(String message){

        return new ResultVo(StatusCode.SUCCESS_CODE,message,null);
    }
    public static ResultVo fail(String message){

        return new ResultVo(StatusCode.FAIL_CODE,message,null);
    }
    public static ResultVo noAuth(String message){

        return new ResultVo(StatusCode.NO_AUTH,message,null);
    }
}